# sorted函数
students = [
    {'name': 'lucy', 'age': 18},
    {'name': 'tom', 'age': 16},
    {'name': 'jose','age' : 20},
    {'name': 'rose','age' : 25},
]

result5 = sorted(students,key = lambda x : x['age'])
print(result5)

result6 = sorted(students,key = lambda x : x['age'],reverse=True)
print(result6)